package servlet;

import java.io.IOException;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import dao.UserDao;
import entity.UserInfo;

public class UserDetailServlet extends HttpServlet {
	protected void service(HttpServletRequest request,HttpServletResponse response)
			throws ServletException,IOException{
		request.setCharacterEncoding("UTF-8");
		response.setContentType("text/html; charset=UTF-8");
		
		String username = (String)request.getSession().getAttribute("loginFlg");
		UserInfo user = new UserDao().get(username);
		
		request.setAttribute("user", user);
		request.getRequestDispatcher("userDetail.jsp").forward(request,response);
		
	}

}
